package mil.af.amc.adpetracker.model;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Enum type to specify types of ADPE equipment managed by the system
 *
 * @author TSgt Jason Ferguson
 */

public enum ItemType {

    WORKSTATION("Workstation"),
    MONITOR("Monitor"),
    PRINTER("Printer"),
    SERVER("Server"),
    NOTEBOOK("Notebook"),
    TABLET("Tablet PC"),
    HANDHELD("Handheld"),
    OTHER("Other");

    private String description;

    ItemType(String description) {
       this.description = description;
   }

    public String getDescription() {
        return description;
    }

    public int getOrdinalValue() {
        return this.ordinal();
    }

    public List<Integer> getOrdinals() {

        List<ItemType> enumList = Arrays.asList(this.values());
        List<Integer> ordinalList = new ArrayList();
        for (ItemType anEnumList : enumList) {
            ordinalList.add(anEnumList.ordinal());
        }

        return ordinalList;
        
    }

    public List<String> getValues() {
        ItemType[] enumValues = this.values();
        List<ItemType> enumList = Arrays.asList(enumValues);
        List<String> results = new ArrayList<String>();

        for (ItemType anEnumList : enumList) {
            results.add(anEnumList.getDescription());
        }

        return results;

    }
}
